<?php

$this->breadcrumbs = array(
    'person',
);

$this->menu = array(
    array('label' => '新建 联络人', 'url' => array('create')),
    array('label' => '管理 联络人', 'url' => array('admin')),
);
?>

<p>
    你可以输入一个查询操作 (<b>&lt;</b>, <b>&lt;=</b>, <b>&gt;</b>, <b>&gt;=</b>, <b>&lt;&gt;</b>
    or <b>=</b>) 在下面空白的栏位或下拉菜单.仅支持简体字查询.
</p>
<?php

$this->widget('zii.widgets.grid.CGridView', array(
    'id' => 'person-grid',
    'dataProvider' => $model->search(),
    'filter' => $model,
    //'dataProvider' => $dataProvider,
    'columns' => array(
        // 'id',
        array(// display 'department.name' using an expression
            'header' => '部门',
            'name' => 'departmentId',
            'value' => '$data->department->name',
            'filter' => CHtml::listData(Department::model()->findAll(), 'id', 'name'),
            'headerHtmlOptions' => array('width' => '70'),
            'htmlOptions' => array('align' => 'center'),
        ),
        array(// display 'door.name' using an expression
            'header' => '职称',
            'name' => 'titleID',
            'value' => '$data->title->name',
            'filter' => CHtml::listData(Title::model()->findAll(), 'id', 'name'),
            'headerHtmlOptions' => array('width' => '70'),
            'htmlOptions' => array('align' => 'center'),
        ),
        array('name' => 'name', 'type' => 'raw',
            // 'filter' => true,
            'value' => 'CHtml::link($data->name, array("view", "id"=>$data->id))', 'htmlOptions' => array('width' => '50px')),
        // 'name',
        'english',
        'mobile',
        'Ext',
        'short',
        // 'skype',
        array(
            'name' => 'mail',
            'type' => 'raw',
            'value' => 'CHtml::link(CHtml::encode($data->mail), "mailto:".CHtml::encode($data->mail))',
        ),
        array(
            'name' => 'image',
            'type' => 'html',
            // 'value' => 'CHtml::image("images/123.jpg","", array("width"=>25))',//显示图片
            // 'value' => 'CHtml::image("images/"."$data->image","", array("width"=>25))',//显示图片
           'value' => 'CHtml::link(CHtml::image("images/"."$data->image",$data->image,array("width"=>20)),array("view", "id"=>$data->id))', //图片添加链接
        ),
    // 'memo',
    ),
));

?>
